

package com.hazelcast.internal.jmx.suppliers;

import com.hazelcast.collection.ISet;
import com.hazelcast.collection.LocalCollectionStats;
import com.hazelcast.internal.monitor.impl.LocalSetStatsImpl;

/**
 * Implementation of {@link StatsSupplier} for {@link ISet}
 */
public class LocalSetStatsSupplier implements StatsSupplier<LocalCollectionStats> {

    private final ISet set;

    public LocalSetStatsSupplier(ISet set) {
        this.set = set;
    }

    @Override
    public LocalCollectionStats getEmpty() {
        return new LocalSetStatsImpl();
    }

    @Override
    public LocalCollectionStats get() {
        return set.getLocalSetStats();
    }
}
